/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.phone.entity;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 用户表Entity
 * @author lzw
 * @version 2019-04-03
 */
@Table(name="users", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="user_name", attrName="userName", label="用户名", queryType=QueryType.LIKE),
		@Column(name="passowrd", attrName="passowrd", label="密码"),
		@Column(name="accounts", attrName="accounts", label="帐号"),
		@Column(name="create_time", attrName="createTime", label="创建时间"),
	}, orderBy="a.id DESC"
)
public class Users extends DataEntity<Users> {
	
	private static final long serialVersionUID = 1L;
	private String userName;		// 用户名
	private String passowrd;		// 密码
	private String accounts;		// 帐号
	private Date createTime;		// 创建时间
	
	public Users() {
		this(null);
	}

	public Users(String id){
		super(id);
	}
	
	@Length(min=0, max=50, message="用户名长度不能超过 50 个字符")
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}
	
	@Length(min=0, max=20, message="密码长度不能超过 20 个字符")
	public String getPassowrd() {
		return passowrd;
	}

	public void setPassowrd(String passowrd) {
		this.passowrd = passowrd;
	}
	
	@Length(min=0, max=20, message="帐号长度不能超过 20 个字符")
	public String getAccounts() {
		return accounts;
	}

	public void setAccounts(String accounts) {
		this.accounts = accounts;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="创建时间不能为空")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
}